package com.scc.architecture;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.scc.architecture.databinding.ActivityMainBinding;
import com.example.module_mvc.controller.MVCActivity;
import com.example.module_mvp.view.MVPActivity;
import com.example.module_mvvm.view.MvvmActivity;

@Route(path = "/app/MainActivity")
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    ActivityMainBinding mainBinding ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mainBinding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(mainBinding.getRoot());
        mainBinding.btnMvc.setOnClickListener(this);
        mainBinding.btnMvp.setOnClickListener(this);
        mainBinding.btnMvvm.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.btn_mvc){
            startActivity(new Intent(this, MVCActivity.class));
        }else if (id == R.id.btn_mvp){
            startActivity(new Intent(this, MVPActivity.class));
        }else if (id == R.id.btn_mvvm){
            startActivity(new Intent(this, MvvmActivity.class));
        }
    }
}